package com.advertisementsystem.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.Builder;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;

import java.time.LocalDateTime;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("notification")
public class Notification {

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    // 接收用户ID
    private Long userId;

    // 消息标题
    private String title;

    // 消息内容
    private String content;

    // 消息类型: NEGOTIATION_COMPLETED, SCHEDULE_CANCELED, SYSTEM_NOTIFICATION
    private String type;

    // 消息状态: 0-未读, 1-已读
    // 为所有SQL操作转义read关键字
    @TableField(value = "`read`")
    private Integer read;

    // 相关目标ID (如协商ID, 排期ID等)
    private Long targetId;

    // 目标URL (点击消息后跳转的路径)
    private String targetUrl;

    // 创建时间
    private LocalDateTime createdTime;

    // 更新时间
    private LocalDateTime updatedTime;
}